package Application.Widgets.TextFileds;

import Application.Widgets.ErrorReportWidget;

import javax.swing.*;

public class TextFiledString extends JTextField
{
    private String WidgetName = "";
    private String BaseValue = "";

    public TextFiledString(String baseValue) {this.BaseValue = baseValue;}
    public void setWidgetName(String name)
    {
        this.WidgetName = name;
    }
    public String getWidgetName() {return this.WidgetName;}

    public String getValue()
    {
        String value = BaseValue;
        if (!this.getText().equals("") && this.getText() != null)
        {
            value = this.getText();
        }else
        {
            ErrorReportWidget.errorReport.append("系统：参数不能为空或者不合法！位置："+this.getWidgetName()+"\n");
        }
        return value;
    }
}
